<?php echo View::make('admin.common.header'); ?>

<div id="header">
    <?php echo View::make('admin.common.left')->with('is_dashboard', true);?>
    <div class="fr1">
        
        <div class="main-content">

	<div class="box-positon">
		<div class="rpos">当前位置: 视频管理 - 编辑视频</div>
		<form class="ropt" action="/admin/video/index">
			<input type="submit" value="返回列表" class="return-button">
		</form>
		<div class="clear"></div>
	</div>
	
        <div class="toast" id="toast">
                <!--{$msg}-->
        </div>
	
	<div class="body-box">
		<form method="post" action="/admin/video/manage" id="jvForm">
			<table width="100%" class="pn-ftable" cellpadding="2" cellspacing="1" border="0">
				<tr>
					<td width="10%" class="pn-flabel pn-flabel-h">选选择分类:</td>
					<td colspan="3" width="90%" class="pn-fcontent ums-category">
                                        <?php $count = 1;if (!empty($brothers)): foreach($brothers as $key => $values): ?>
                                <span class="ums-cat">
                                    <select name="super" id="top-cat" class="cat-select">
                                        <option value=""><?php echo $count;?>级分类</option>
										<?php $count += 1;foreach($values as $k => $value):?>

										<?php if ($value['id'] == $key){ ?>
                                        <option selected value="<?php echo $value['id'];?>"><?php echo $value['name'];?></option>
										<?php }else{?>	
                                        <option value="<?php echo $value['id'];?>"><?php echo $value['name'];?></option>
										
										<?php }?>	
										<?php endforeach;?>
                                    </select>
                                </span> 

							<?php endforeach; endif; ?>

                                        <?php if (!empty($top_cat)):?>
                                <span class="ums-cat">
                                    <select name="super" id="top-cat" class="cat-select">
                                        <option value="">1级分类</option>
										<?php foreach ($top_cat as $cat): ?>
                                                <option value="<?php echo $cat->id; ?>"><?php echo $cat->name; ?></option>
                                            <?php endforeach; ?>
                                    </select>
                                </span> 
											<?php endif; ?>
						<!--
						<span style="margin-left:40px;">
							<select name="parent" id="children-cat" class="cat-select">
								<option value="">二级分类</option>
							</select>
						</span>
						<span style="margin-left:40px;">
							<select name="child" id="child-cat" class="cat-select">
								<option value="">三级分类</option>
							</select>
						</span>
						-->
						<span style="margin-left:40px;" class="error" id="cat-info"></span>
						<input type="hidden" name="category_id" value="<?php echo $video['category_id'];?>" id="category_id">
					</td>
				</tr>
				<tr>
					<td width="10%" class="pn-flabel pn-flabel-h"><span class="pn-frequired">*</span>视频标题:</td>
					<td colspan="3" width="100%" class="pn-fcontent">
						<input type="text" maxlength="100" name="title" id="name" class="required" style="width:350px;" value="<?php echo $video['title']?>" />
					</td>
				</tr>
				<tr>
					<td width="10%" class="pn-flabel pn-flabel-h">视频描述:</td>
					<td colspan="3" width="90%" class="pn-fcontent">
						<textarea cols="70" rows="3" name="description" id="description" maxlength="255"><?php echo $video['description']; ?></textarea>
					</td>
				</tr>
                                <tr>
					<td width="10%" class="pn-flabel pn-flabel-h">视频时长:</td>
					<td colspan="3" width="90%" class="pn-fcontent">
						<input type="text" maxlength="3" name="duration" id="sort" class="required" style="width:50px;" value="<?php echo $video['duration']?>" />
					</td>
				</tr>
				<tr>
					<td width="10%" class="pn-flabel pn-flabel-h">视频价格:</td>
					<td colspan="3" width="90%" class="pn-fcontent">
						<input type="text" maxlength="3" name="price" id="sort" class="required" style="width:50px;" value="<?php echo $video['price']?>" />
					</td>
				</tr>
				<tr>
					<td width="10%" class="pn-flabel pn-flabel-h">视频标签:</td>
					<td colspan="3" width="90%" class="pn-fcontent">
						<input type="text" maxlength="200" name="tag" id="url" class="required" style="width:450px;" value="<?php echo $video['tag']?>" />
					</td>
				</tr>
				<tr>
					<td width="10%" class="pn-flabel">上传图片:</td>
					<td colspan="3" width="40%" class="pn-fcontent">
						<span id="ufc1" style="position:relative">
							<input type='text' id='uploadFileText1' size="14" value="<?php echo $video['image']?>"/>  
							<input class="browse" type='button' value='浏览'/>
							<input onchange="$('#uploadFileText1').val(this.value)" size="14" type="file" name="uploadFile" id="uploadFile" class="file-button"/>
						</span>
						<input type="button" value="上传" class="upload-button" id="upload-image"/>&nbsp;&nbsp;(推荐尺寸:184*186)
						<span class="error" id="upload-error" style="margin-left:30px;"></span>
					</td>
				</tr>
				<tr>
					<td width="10%" class="pn-flabel">图片预览区:</td>
					<td colspan="3" class="pn-fbutton">
						<img id="preImg" alt="预览" style="background-color:#CCCCCC;border:1px solid #333" src="<?php echo $video['image'];?>"/>
					</td>
				</tr>
				<tr>
					<td width="10%" class="pn-flabel">缩略图:</td>
					<td colspan="3" width="40%" class="pn-fcontent">
						宽: <input type="text" id="zoomWidth" value="" size="5"/> (像素/px)
						高: <input type="text" id="zoomHeight" value="" size="5"/> (像素/px)
						<input type="button" value="确定" class="cut-button" id="thumb-image"/>
						<span class="error" id="cut-error" style="margin-left:30px;">如果不需要打缩略图，请不用操作。(缩略图会按比例缩小上传的原图)</span>
					</td>
				</tr>
			</table>
		</div>
		
			<table width="100%" class="pn-ftable" cellpadding="2" cellspacing="1" border="0">
				<tr>
					<td colspan="4" class="pn-fbutton">
					<span class="error" style="padding-left:100px;" id="error">
						<!--{$error}-->
					</span>
					</td>
				</tr>
				<tr>
					<td colspan="4" class="pn-fbutton">
					<input type="hidden" name="image" value="<?php echo $video['image'];?>" id="picture">
					<input type="hidden" name="id" value="<?php echo $video['id'];?>">
					<input type="hidden" name="do" value="save">
					<input type="submit" value="提交" class="submit" class="submit" id="submit"/> &nbsp; 
					<input type="reset" value="重置" class="reset" class="reset"/>
					</td>
				</tr>
			</table>
		</form>
 	</div>
	
    </div>
        
    </div>    
</div>
<script type="text/javascript" language="javascript">
	setTimeout(function(){umams.admin.Operate.initCategoryEvent();},1000);
</script>
<?php echo View::make('admin.common.footer'); ?>


